/*
 * Cricket.nc
 * Michel Goraczko <michelg@csail.mit.edu>
 *
 * Cricket modules 
 *   
 */

/*
      This software may be used and distributed according to the terms
      of the GNU General Public License (GPL), incorporated herein by reference.
      Drivers based on this skeleton fall under the GPL and must retain
      the authorship (implicit copyright) notice.

      This program is distributed in the hope that it will be useful, but
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
      General Public License for more details.
*/


includes Cricket;

configuration Cricket {
}
implementation {
  components Main, CricketM, RandomLFSR, TimerC, LedsC, SimpleTime;
  components RadioCRCPacket as Comm, CC1000RadioIntM as Radio, SerialM, HPLUARTC;
  components SerialId, UltrasoundControlM, BeacManageM, OnboardTemp;
  components CarM;
  components SingleTimer;
  
  // Save to flash
  components InternalEEPROMC;

  Main.StdControl -> CricketM;
  Main.StdControl -> TimerC;
  Main.StdControl -> SerialId;
  Main.StdControl -> SimpleTime;
  Main.StdControl -> InternalEEPROMC;
  Main.StdControl -> CarM;
  Main.StdControl -> SingleTimer;

  CricketM.WriteData -> InternalEEPROMC;
  CricketM.ReadData -> InternalEEPROMC;
  
  CricketM.BeaconTimer -> TimerC.Timer[unique("BeaconTimer")];
  CricketM.Random -> RandomLFSR;
  CricketM.Time -> SimpleTime.Time;
  CricketM.Leds -> LedsC;
  CricketM.RadioControl -> Comm;
  CricketM.RadioSend -> Comm;
  CricketM.RadioReceive -> Comm;
  CricketM.GetRxBitOffset -> Radio.GetRxBitOffset;
  CricketM.HardwareId -> SerialId;
  CricketM.RadioSendCoord -> Radio.RadioSendCoordinator;
  CricketM.RadioReceiveCoord -> Radio.RadioReceiveCoordinator;
  CricketM.UltrasoundControl -> UltrasoundControlM;
  CricketM.BeaconsManage -> BeacManageM;
  CricketM.BeaconsControl -> BeacManageM;
  CricketM.OnboardTempcontrol -> OnboardTemp;
  CricketM.OnboardTemp -> OnboardTemp.OnboardTemp;
  CricketM.Serial -> SerialM;
  SerialM.HPLUART -> HPLUARTC;
  SerialM.Leds -> LedsC;
  BeacManageM.AgeTimer -> TimerC.Timer[unique("Timer")];

  // Wiring of car controller
  CricketM.CarControl -> CarM;
  CricketM.Car -> CarM;
  CricketM.SingleTimer -> SingleTimer.Timer;
}

